<%
	String fileName=request.getParameter("fileName").trim();
	
	String dir =request.getSession().getServletContext().getRealPath("/");

	String downloadPath = dir+"upload/"+fileName;
//out.print(dir);
//out.print(downloadPath);
response.setContentType("APPLICATION/OCTET-STREAM");
	response.setHeader("Content-Disposition","attachment; filename=\"" + fileName + "\"");
java.io.FileInputStream fileInputStream = new java.io.FileInputStream(downloadPath);
	int i;
	while ((i = fileInputStream.read()) != -1) {
		out.write(i);
        }
	fileInputStream.close();
	out.close();
%>
